import {createSlice} from "@reduxjs/toolkit";

const userStore = createSlice({
    name: 'user',
    initialState: {
        isLogin: false,
        userInfo: {}
    },
    reducers: {
        setUserInfo: (state, action) => {
            state.userInfo = action.payload
        },
        changeLoginStatus: (state, action) => {
            state.isLogin = action.payload
        }
    }
})

const {setUserInfo, changeLoginStatus} = userStore.actions
export {setUserInfo, changeLoginStatus}
export default userStore.reducer